﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>客户信息</title>
    <link href="/CSS/bootstrap3.3.5/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="/CSS/font-awesome-4.3.0/css/font-awesome.css?v=4.3.0" rel="stylesheet">
    <link href="/CSS/V3/animate.css" rel="stylesheet">
    <link href="/CSS/V3/style.css?v=2.2.0" rel="stylesheet">
    <script src="/Scripts/jquery-1.11.2.min.js"></script>
    <script src="/CSS/bootstrap3.3.5/js/bootstrap.js"></script>
    <script src="/Scripts/avalon.js"></script>
    <script src="/Scripts/SZHLCommon.js?jsver=5"></script>
    <script>
        var model = avalon.define({
            $id: "APP_KHGL_LXJL",
            modelData: {},
            khID: ComFunJS.getQueryString("ID", 0),
            modelLXData: { LXLB: "打电话", LXContent: "", RefID: 0 },
            LXDataList: [],
            initForm: function () {
                if (model.khID) {
                    model.modelLXData.RefID = model.khID;
                    //编辑加载数据
                    $.getJSON('/API/FTAPI.ashx?Action=GETKHGLMODEL', { P1: model.khID }, function (resultData) {
                        if (resultData.ErrorMsg == "") {
                            model.modelData = resultData.Result;
                            model.LXDataList = resultData.Result1;
                        }
                    })
                }
            },//初始化
            SaveData: function () {
                if (model.modelLXData.LXLB == "") {
                    parent.ComFunJS.winwarning("请选择类别");
                    return;
                }
                if (model.modelLXData.LXContent == "") {
                    parent.ComFunJS.winwarning("请填写联系记录内容");
                    return;
                }
                var data = model.modelLXData.$model;
                var modelValue = JSON.stringify(data);
                $.post("/API/FTAPI.ashx?ACTION=ADDKHLSJL", { P1: modelValue }, function (result) {
                    var jsonresult = $.parseJSON(result)
                    if ($.trim(jsonresult.ErrorMsg) == "") {
                        parent.ComFunJS.winsuccess("操作成功");
                        model.LXDataList.push(jsonresult.Result);
                        model.modelLXData.LXContent = "";
                    }
                });
            }
        });
        avalon.ready(function () {
            ComFunJS.initsetajax();
            model.initForm();
        })
    </script>
    <style>
        .social-footer .social-comment img {
            width: 32px;
            margin-right: 10px;
        }

        .social-comment:first-child {
            margin-top: 0;
        }

        .social-comment {
            margin-top: 15px;
        }

            .social-comment textarea {
                font-size: 12px;
            }

        .selecttr {
            background-color: #f5f5f5;
        }
    </style>
</head>
<body class="gray-bg" ms-controller="APP_KHGL_LXJL">
    <div class=" animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox ">
                    <div class="ibox-content" style="background: #f9f9f9;height:100%">

                        <div class="row m-b-lg">
                            <div class="col-md-6 text-center">
                                <div class="m-b-sm">
                                    <img alt="image" class="img-circle" src="/images/TX/default.png" style="width: 62px">
                                </div>
                                <h2>{{modelData.KHName}}</h2>
                            </div>
                            <div class="col-md-4">
                                <h3>个人简介</h3>
                                <p><span style="margin-right:10px">{{modelData.KHName}}{{modelData.KHXinBie}}</span>  {{modelData.KHZhiWu}}</p>
                                <p>{{modelData.KHDW}}</p>
                                <p><span style="margin-right:10px">{{modelData.KHPhone}}</span>  {{modelData.KHZJ}}</p>
                                <p>{{modelData.KHEmail}}</p>
                                <br>
                            </div>
                        </div>
                        <div class="client-detail" style=" height: auto;">
                            <div class="full-height-scroll">
                                <h3>
                                    联系地址
                                </h3>
                                <p>
                                    {{modelData.KHAdress}}
                                </p>
                                <h3>
                                    负责人
                                </h3>
                                <!--<span style="line-height:30px" ms-repeat-usr="ComFunJS.convertuser(modelData.KHFXRS).split(',')">
                                    <label class="label label-default" style=" margin-right:5px;">{{usr}}</label>
                                </span>-->
                                <span class="text-success" style="line-height:30px" ms-repeat-usr="modelData.KHFXRS.split(',')">
                                    <span style=" margin-right:5px;">{{ComFunJS.convertuser(usr)}}</span>
                                </span>

                                <h3>联系记录</h3>
                                <div class="social-footer">
                                    <div class="social-comment" ms-repeat-item="LXDataList">
                                        <span class="pull-left">
                                            <img alt="image" ms-attr-src="'/Upload/TX/'+item.CRUser+'.jpg'" onerror="javascript: this.src = '/images/TX/default.png'">
                                        </span>
                                        <div class="media-body">
                                            <span style="color: #3085DB;">
                                                {{item.LXR}}
                                            </span>
                                            <small class="text-muted pull-right">{{item.CRDate|date("MM月dd日 HH:mm")}}</small>
                                            <br />
                                            <span style="margin-top: 5px; line-height: 30px;">
                                                <label class="label label-info" style="margin-right:10px">{{item.LXLB}} </label>
                                                {{item.LXContent}}
                                            </span>
                                        </div>
                                    </div>
                                    <div class="social-comment">
                                        <span class="pull-left" style="line-height:47px">
                                            <img alt="image" src="/images/TX/default.png">
                                        </span>
                                        <div class="media-body">
                                            <div class="row m-b-sm m-t-sm">

                                                <div class="col-md-4">
                                                    <select class="form-control m-b" name="account" ms-duplex="modelLXData.LXLB">
                                                        <option value="打电话">打电话</option>
                                                        <option value="发邮件">发邮件</option>
                                                        <option value="发短信">发短信</option>
                                                        <option value="见面拜访">见面拜访</option>
                                                        <option value="汇报记录">汇报记录</option>
                                                        <option value="活动">活动</option>
                                                    </select>
                                                </div>
                                                <div class="col-md-8">
                                                    <div class="input-group">
                                                        <input type="text" class="form-control" placeholder="填写联系内容" ms-duplex="modelLXData.LXContent" />
                                                        <span class="input-group-btn">
                                                            <button type="button" class="btn btn btn-primary" ms-click="SaveData()">  添加联系记录</button>
                                                        </span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

